package com.migu.contacts.net;

import com.frank.libandroid.HttpLiveData;
import com.frank.libandroid.RetrofitUtil;
import com.migu.contacts.bean.ActionBean;
import com.migu.contacts.bean.AddressBean;
import com.migu.contacts.bean.BirthdayDetailBean;
import com.migu.contacts.bean.BirthdayWordsBean;
import com.migu.contacts.bean.ContactBean;
import com.migu.contacts.bean.DetailBean;
import com.migu.contacts.bean.DocumentScoreBean;
import com.migu.contacts.bean.EventBean;
import com.migu.contacts.bean.Feedback;
import com.migu.contacts.bean.FestivalBean;
import com.migu.contacts.bean.FestivalCountDownBean;
import com.migu.contacts.bean.ForgetPwdReq;
import com.migu.contacts.bean.GiftBean;
import com.migu.contacts.bean.GiftCountDownDetailBean;
import com.migu.contacts.bean.GroupBean;
import com.migu.contacts.bean.GuideDescBean;
import com.migu.contacts.bean.HelpBean;
import com.migu.contacts.bean.IndustryBean;
import com.migu.contacts.bean.InvitationBean;
import com.migu.contacts.bean.LabelBean;
import com.migu.contacts.bean.LoginReq;
import com.migu.contacts.bean.LoginRes;
import com.migu.contacts.bean.MessageBean;
import com.migu.contacts.bean.MobileChangeRequest;
import com.migu.contacts.bean.MomentBean;
import com.migu.contacts.bean.MonthBean;
import com.migu.contacts.bean.OcrBean;
import com.migu.contacts.bean.OcrReq;
import com.migu.contacts.bean.OssToken;
import com.migu.contacts.bean.Page;
import com.migu.contacts.bean.PasswordChangeRequest;
import com.migu.contacts.bean.PayRequest;
import com.migu.contacts.bean.PayResponse;
import com.migu.contacts.bean.PositionBean;
import com.migu.contacts.bean.PrivacyBean;
import com.migu.contacts.bean.RegisterReq;
import com.migu.contacts.bean.ServiceBean;
import com.migu.contacts.bean.TimerBean;
import com.migu.contacts.bean.UserBean;
import com.migu.contacts.bean.UserScoreBean;
import com.migu.contacts.bean.VipBean;
import com.migu.contacts.main.create.OcrListActivity;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface Service {
    public static final String BASE_URL = "https://app.funi.net.cn";
    public static Service API = RetrofitUtil.create(BASE_URL, Service.class);

    // 1:账号注册  2: 登录   3: 忘记密码
    @GET("/sms/send/{type}/{mobile}")
    HttpLiveData<Boolean> sendSms(@Path("type") int type, @Path("mobile") String mobile);

    @POST("/user/register")
    HttpLiveData<Boolean> register(@Body RegisterReq req);

    //    password : 密码
//    sms_code : 短信验证码
//    Wechat : 微信授权码登录
//    qq : 微信授权码登录
//    weibo : 微信授权码登录
    @POST("/login/token")
    HttpLiveData<LoginRes> login(@Body LoginReq req);

    @POST("/user/password/forget")
    HttpLiveData<Boolean> passwordForget(@Body ForgetPwdReq req);

    @GET("/contacts/all")
    HttpLiveData<List<ContactBean>> contactsAll();

    @DELETE("/contacts/delete/{id}")
    HttpLiveData<Boolean> contactsDelete(@Path("id") int id);

    @DELETE("/calendar/delete/{id}")
    HttpLiveData<Boolean> calendarDelete(@Path("id") int id);

    @GET("/common/address")
    HttpLiveData<List<AddressBean>> getAddress();

    @GET("/common/industry")
    HttpLiveData<List<IndustryBean>> getIndustry();

    @GET("/common/position")
    HttpLiveData<List<PositionBean>> getPosition();

    @GET("/label/query")
    HttpLiveData<List<LabelBean>> queryLabel();

    @POST("/label/add")
    HttpLiveData<LabelBean> addLabel(@Body LabelBean bean);

    @GET("/group/query")
    HttpLiveData<List<GroupBean>> queryGroup();

    @POST("/group/edit")
    HttpLiveData<Boolean> editGroup(@Body GroupBean groupBean);

    @GET("/festival/query")
    HttpLiveData<List<FestivalBean>> queryFestival();

    @GET("/festival/greetings/{type}")
    HttpLiveData<List<FestivalBean>> queryFestivalGreetings(@Path("type") int type, @Query("festivalId") int festivalId);

    @POST("/group/add")
    HttpLiveData<GroupBean> addGroup(@Body GroupBean bean);

    @POST("/contacts/add")
    HttpLiveData<Integer> contactsAdd(@Body ContactBean bean);

    @POST("/contacts/edit")
    HttpLiveData<Boolean> contactsEdit(@Body ContactBean bean);

    @POST("/calendar/create")
    HttpLiveData<Boolean> calendarCreate(@Body DetailBean bean);

    @GET("/message/page")
    HttpLiveData<MessageBean> getMessage(@Query("current") int current, @Query("size") int size, @Query("id") int id);

    @GET("/user/info")
    HttpLiveData<UserBean> getUserInfo();

    @POST("/user/edit")
    HttpLiveData<Boolean> useEdit(@Body UserBean bean);

    @GET("/festival/gift")
    HttpLiveData<List<GiftBean>> getGift(@Query("groupId") Integer groupId, @Query("gender") Integer gender, @Query("festivalId") Integer festivalId);

    //1: 上传头像  2=上传名片 3=意见反馈
    @GET("/common/sts/{type}")
    Call<Result<OssToken>> getOssToken(@Path("type") int id);

    @POST("/contacts/ocr")
    HttpLiveData<OcrBean> ocr(@Body OcrReq req);

    @GET("/festival/birthday/{type}")
    HttpLiveData<List<BirthdayWordsBean>> getBirthdayWords(@Path("type") int type);

    @GET("/calendar/day/{date}")
    HttpLiveData<List<EventBean>> getCalendarDay(@Path("date") String date);

    @GET("/calendar/month/{date}")
    HttpLiveData<List<MonthBean>> getCalendarMonth(@Path("date") String date);

    @GET("/timer/page")
    HttpLiveData<Page<TimerBean>> getTimerPage(@Query("status") int status, @Query("current") int current, @Query("size") int size, @Query("order") String order);

    @GET("/calendar/detail/{id}")
    HttpLiveData<DetailBean<FestivalCountDownBean>> getCalendarFestivalDetail(@Path("id") int id);

    // 1=生日 2=节日 3=礼物 4=行事历 5=周期 6=重要时刻
    @GET("/calendar/detail/{id}")
    HttpLiveData<DetailBean<ActionBean>> getCalendarActionDetail(@Path("id") int id);

    @GET("/calendar/detail/{id}")
    HttpLiveData<DetailBean<BirthdayDetailBean>> getCalendarBirthdayDetail(@Path("id") int id);

    @GET("/calendar/detail/{id}")
    Call<Result<DetailBean<MomentBean>>> getMomentDetail(@Path("id") int id);

    @DELETE("/label/delete/{id} ")
    Call<Result<Boolean>> labelDelete(@Path("id") int id);

    @GET("/common/document/score")
    Call<Result<DocumentScoreBean>> getDocumentScore();

    @POST("/calendar/edit")
    Call<Result<Boolean>> calendarEdit(@Body DetailBean detailBean);

    @GET("/contacts/ocr/list")
    Call<Result<Page<OcrListActivity.OcrBean>>> ocrList(@Query("current") int current, @Query("size") int size);

    //1=通知 0=不通知
    @POST("/message/set/{status}")
    Call<Result<Boolean>> message_set(@Path("status") int id);

    // 1=待执行  2=已完成
    @POST("/calendar/status/{id}/{status}")
    Call<Result<Boolean>> calendarChangeStatus(@Path("id") int id, @Path("status") int status);

    @GET("/common/document/guide")
    Call<Result<List<GuideDescBean>>> commonDocumentGuide();

    @GET("/common/document/help")
    Call<Result<List<HelpBean>>> commonDocumentHelp();

    @GET("/common/document/privacy")
    Call<Result<PrivacyBean>> commonDocumentPrivacy();

    @GET("/common/document/user")
    Call<Result<PrivacyBean>> commonDocumentUser();

    @GET("/common/document/customer")
    Call<Result<ServiceBean>> commonDocumentCustomer();

    @GET("/order/invitation/page")
    Call<Result<Page<InvitationBean>>> orderInvitationPage(@Query("current") int current, @Query("size") int size);

    @GET("/calendar/detail/{id}")
    HttpLiveData<DetailBean<GiftCountDownDetailBean>> getCalendarGiftDetail(@Path("id") int id);

    @GET("/user/score")
    HttpLiveData<UserScoreBean> getUserScore();

    @POST("/order/score/create/{id}")
    HttpLiveData<Double> scoreOrderCreate(@Path("id") int id);

    @POST("/common/feedback")
    HttpLiveData<Boolean> feedback(@Body Feedback id);

    @POST("/user/mobile/change")
    HttpLiveData<Boolean> mobileChange(@Body MobileChangeRequest id);

    @POST("/user/password/change")
    HttpLiveData<Boolean> passwordChange(@Body PasswordChangeRequest id);

    @GET("/order/product")
    HttpLiveData<List<VipBean>> getProduct();

    @POST("/order/create")
    HttpLiveData<PayResponse> orderCreate(@Body PayRequest request);
}
